import request from '@/utils/request'
/**
 *  获取组织架构列表
 * @returns  promise
 */
export function getDepartments() {
  return request({
    url: '/company/department',
    method: 'GET'
  })
}
/**
 *  根据部门id 删除部门
 * @param {*} id  部门id
 * @returns promise
 */
export function delDeptsById(id) {
  return request({
    url: '/company/department/' + id,
    method: 'DELETE'
  })
}
/**
 *  新增部门
 * @param {*} data {}
 * @returns
 */
export function addDepartments(data) {
  return request({
    url: '/company/department',
    method: 'POST',
    data
  })
}
/**
 *  更新部门
 * @param {*} data  修改部门数据
 * @returns
 */
export function updateDepartments(data) {
  return request({
    url: '/company/department/' + data.id,
    method: 'PUT',
    data
  })
}
